package com.zxx.pattern.factoryPattern.factoryDelete.method;

import com.zxx.pattern.factoryPattern.factoryDelete.simple.Pizza;

/**
 * @author zxx on 2020/12/28
 */
public abstract class PizzaFactory2 {

    public Pizza orderPizza(String type) {
        Pizza pizza;
        pizza = createPizza(type);

        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();

        return pizza;
    }

    /*
15      * 创建pizza的方法交给子类去实现
16      */
    protected abstract Pizza createPizza(String type);

}
